package com.manage.base.bean;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class Page
		implements ClearBean {

	private int currentPage;

	private int pageSize;

	private int total;

	private Date startDate;

	private Date endDate;

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getStart() {
		return (this.currentPage - 1) * pageSize;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		if (startDate != null) {
			SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");// 格式化对象
			Calendar calendar = Calendar.getInstance();// 日历对象
			calendar.setTime(startDate);// 设置当前日期
			calendar.add(Calendar.MONTH, 1);// 月份加1
			try {
				endDate = sdf.parse(sdf.format(calendar.getTime()));
			} catch (ParseException e) {
			}
		}
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	@Override
	public void clear() {
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}
}
